<include file="Core:Public:header" />
{:W('Navigation')}
<div class="body-right">
	<div class="row-table">
		<div class="row-table-title">绩效考核管理</div>
		<div class="row-table-body">
			<p class="form-title"><a href="{:U('hrm/appraisalmanager/enableTemplate')}" class="pull-right btn btn-primary btn-xs">添加</a>绩效考核管理</p>
			<if condition="empty($managerlist)">
				<div>---暂无数据---</div>
			<else />
			<form class="form-horizontal " id="form1"  method="post">
				<table class="table" style="margin-bottom:0px;">
					<tbody>
						<tr>
							<th><input type="checkbox" name="appraisal_manager_id[]" id="check_all"/></th>
							<th>名称</th>
							<th>模板名称</th>
							<th>启用时间</th>
							<th>截止时间</th>
							<th>负责人</th>
							<th>进度</th>
							<th>状态</th>
							<th>考核成绩</th>
							<th>操作</th>
						</tr>
						<volist name="managerlist" id="vo">
						<tr>
							<td><input type="checkbox" name="id[]" class="check_list" value="{$vo.appraisal_manager_id}" /></td>
							<td><a href="{:U('hrm/appraisalmanager/view','id='.$vo['appraisal_manager_id'])}">{$vo.name}</a></td>
							<td><a href="{:U('hrm/appraisaltemplate/view','id='.$vo['template']['appraisal_template_id'])}" target="_blank">{$vo.template.name}</a></td>
							<td>{$vo.start_time|date='Y-m-d',###}</td>
							<td>{$vo.end_time|date='Y-m-d',###}</td>
							<td>{$vo.executor_user_name}</td>
							<td>{$vo.not_examin_examiner_num}&nbsp;/&nbsp;{$vo.total_examiner_num}</td>
							<td>{$vo.status_name}</td>
							<td>
								<if condition="'2' eq $vo['status']">
									<a href="{:U('hrm/appraisalpoint/results','id='.$vo['appraisal_manager_id'])}">成绩</a>
								<else />
									暂无成绩
								</if>
							</td>
							<td>
								<if condition="'1' eq $vo['status']">
									<a href="javascript:void(0);" class="status_summary" title="汇总" rel="{$vo['appraisal_manager_id']}">	汇总</a>
								<elseif condition="'2' eq $vo['status']"/>
									<a href="javascript:void(0);" class="status_reset" title="撤销汇总" rel="{$vo['appraisal_manager_id']}">撤销</a>
								</if>
								&nbsp;|&nbsp;
								<if condition="'1' eq $vo['status']">
									<a href="{:U('hrm/appraisalmanager/delete','id='.$vo['appraisal_manager_id'])}">删除</a>
								<else />
									<del>删除</del>	
								</if>
							</td>
						</tr>
						</volist>
					</tbody>
					<tfoot>
						<tr>
							<td colspan="7">
								<input class="btn btn-primary btn-xs" type="submit" id="delete" value="删除"/>
							</td>
						</tr>
						<tr>
							<td colspan="7" align="center">{$page}<div class="clear"></div></td>
						</tr>
					</tfoot>
				</table>
			</form>
			</if>
		</div>
	</div>
</div>
<div class="clear"></div>
<script type="text/javascript">
	/**
	 * 全选
	 **/
	$("#check_all").click(function(){
		$("input[class='check_list']").prop('checked',$(this).prop('checked'));
	});
	
	/**
	 * 批量删除
	 **/
	$("#delete").click(function(){
		if(confirm('确定要删除吗？')){
			$("#form1").attr("action","{:U('hrm/appraisalmanager/delete')}");
			$("#form1").submit();
		}
	});
	
	/**
	 * 汇总
	 **/
	$(".status_summary").click(function(){
		var appraisal_manager_id = $(this).attr('rel');
		if(confirm('确定要汇总数据吗？')){
			$('#alert').modal({
				show:true,
				remote:"{:U('hrm/appraisalmanager/summary', 'appraisal_manager_id')}"+appraisal_manager_id
			});
		}
	});
	
	/**
	 * 撤销汇总
	 **/
	$(".status_reset").click(function(){
		var appraisal_manager_id = $(this).attr('rel');
		if(confirm('确定要撤销汇总吗？')){
			location.href = "{:U('hrm/appraisalmanager/reset', 'appraisal_manager_id')}"+appraisal_manager_id;
		}
	});
</script>
<include file="Core:Public:alert" />
<include file="Core:Public:footer" />